home *** CD-ROM | disk | FTP | other *** search
/ Mars Digital Image Map / Mars Digital Image Map - Disc 1.iso / software / vax / cdcopy.com next >
Text File  |  1991-11-14  |  9KB  |  116 lines

  1. $!************************************************************************    
  2. $!                                                                            
  3. $!_TITLE CDCOPY - Command file to copy CDROM files to magnetic disk           
  4. $!                                                                            
  5. $!_DESCR                                                                      
  6. $!                                                                            
  7. $!     The CDCOPY command file is to be used by VAX/VMS systems for           
  8. $!     copying data files from CDROM media to VMS magnetic disk media.        
  9. $!     This command file is used  in conjunction with the VFS-ISO 9660        
  10. $!     MOUNT field test kit which allows VMS interface with the CDROM         
  11. $!     ISO volume and directory standard.                                     
  12. $!                                                                            
  13. $!     The current VMS interface to CDROMs (VFS field test kit) has           
  14. $!     problems with files that have extended attribute records with          
  15. $!     a print control value of 0. The dcl COPY command, and other            
  16. $!     DCL commands, generates an error message when trying to access         
  17. $!     these kinds of files. The dcl CONVERT utility will properly            
  18. $!     copy these files to the VMS environment. The CDCOPY command            
  19. $!     file will create an appropriate FDL file for the given input           
  20. $!     CDROM file and then execute the CONVERT utility.                       
  21. $!                                                                            
  22. $!     The CDCOPY command file will convert fixed-length,                     
  23. $!     variable-length, and stream record files. If a file on the             
  24. $!     CDROM does not contain an extended attribute record, then the          
  25. $!     command file assumes the file is a stream record file and              
  26. $!     convert it accordingly.                                                
  27. $!                                                                            
  28. $!     BUG NOTE: Stream record files are not properly converted to the        
  29. $!     VMS format. The convert utility program adds a carriage-return         
  30. $!     line-feed sequence on every 512 byte boundary in the file. These       
  31. $!     extraneous bytes can be removed by editing the converted               
  32. $!     document.                                                              
  33. $!                                                                            
  34. $!     HOW TO RUN THE COMMAND FILE:                                           
  35. $!                                                                            
  36. $!     You can run the CDCOPY command file with the following command:        
  37. $!                                                                            
  38. $!     $@CDCOPY  in-spec out-spec                                             
  39. $!                                                                            
  40. $!     where 'in-spec' is the input file specification and 'out-spec'         
  41. $!     is the output file specification. Wild card file specifications        
  42. $!     are permitted.  Shown below are a few examples of how to run           
  43. $!     the command file (the CDROM device name is assumed to be DUD7:):       
  44. $!                                                                            
  45. $!     $@CDCOPY DUD7:[INDEX]IMGINDEX.TAB *                                    
  46. $!     $@CDCOPY DUD7:[MG05NXXX]*.IMG *                                        
  47. $!     $@CDCOPY DUD7:[GAZETTER]GAZETTER.TAB OUT:TEST.TAB                      
  48. $!                                                                            
  49. $!                                                                            
  50. $!_HIST Eric Eliason, USGS Flagstaff, Origianl Version                        
  51. $!*************************************************************************   
  52. $        PFILE = ""                                                         ! 
  53. $        FILESPEC = P1                                                      ! 
  54. $        OFILE = P2                                                         ! 
  55. $        IF P1.EQS.""   -                                                   ! 
  56.          THEN           -                                                   ! 
  57.            INQUIRE FILESPEC "Enter CDROM input file specification"          ! 
  58. $!       ENDIF                                                              ! 
  59. $        IF P2.EQS.""   -                                                   ! 
  60.          THEN           -                                                   ! 
  61.            INQUIRE OFILE   "Enter output magnetic disk device "             ! 
  62. $!       ENDIF                                                              ! 
  63. $LOOP:                                                                      ! 
  64. $        IFILE = F$SEARCH(FILESPEC)                                         ! 
  65. $        IF IFILE.EQS.PFILE THEN GOTO DONE                                  ! 
  66. $        PFILE = IFILE                                                      ! 
  67. $        IF IFILE.EQS."" THEN GOTO DONE                                     ! 
  68. $        MRS = F$FILE_ATTRIBUTES(IFILE,"MRS")                               ! 
  69. $        RFM = F$FILE_ATTRIBUTES(IFILE,"RFM")                               ! 
  70. $        IF RFM .EQS. "FIX" THEN GOTO FIX                                   ! 
  71. $        IF RFM .EQS. "VAR" THEN GOTO VAR                                   ! 
  72. $        IF RFM .EQS. "UDF" THEN GOTO UDF                                   ! 
  73. $        GOTO ERROR                                                         ! 
  74. $FIX:    OPEN/WRITE  T CD.FDL                                               ! 
  75. $        WRITE T "RECORD"                                                   ! 
  76. $        WRITE T "   BLOCK_SPAN       YES"                                  ! 
  77. $        WRITE T "   CARRIAGE_CONTROL NONE"                                 ! 
  78. $        WRITE T "   FORMAT           FIXED"                                ! 
  79. $        WRITE T "   SIZE            ",MRS                                  ! 
  80. $        CLOSE T                                                            ! 
  81. $        WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE                        ! 
  82. $        WRITE SYS$OUTPUT "fixed-length record file is assumed"             ! 
  83. $        GOTO CVT                                                           ! 
  84. $VAR:    OPEN/WRITE T CD.FDL                                                ! 
  85. $        WRITE T "RECORD"                                                   ! 
  86. $        WRITE T "   BLOCK_SPAN       YES"                                  ! 
  87. $        WRITE T "   CARRIAGE_CONTROL NONE"                                 ! 
  88. $        WRITE T "   FORMAT           VARIABLE"                             ! 
  89. $        WRITE T "   SIZE             0"                                    ! 
  90. $        CLOSE T                                                            ! 
  91. $        WRITE SYS$OUTPUT "variable-length record file is assumed"          ! 
  92. $        WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE                        ! 
  93. $        GOTO CVT                                                           ! 
  94. $UDF:    OPEN/WRITE T CD.FDL                                                ! 
  95. $        WRITE T "RECORD"                                                   ! 
  96. $        WRITE T "   BLOCK_SPAN       YES"                                  ! 
  97. $        WRITE T "   CARRIAGE_CONTROL NONE"                                 ! 
  98. $        WRITE T "   FORMAT           STREAM"                               ! 
  99. $        WRITE T "   SIZE             0"                                    ! 
  100. $        CLOSE T                                                            ! 
  101. $        WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE                        ! 
  102. $        WRITE SYS$OUTPUT "file has undefined format, stream file assumed"  ! 
  103. $        GOTO CVT                                                           ! 
  104. $CVT:                                                                       ! 
  105. $        WRITE SYS$OUTPUT " "                                               ! 
  106. $        CONVERT/FDL=CD.FDL 'IFILE' 'OFILE'                                 ! 
  107. $        DELETE CD.FDL;                                                     ! 
  108. $        GOTO LOOP                                                          ! 
  109. $                                                                           ! 
  110. $DONE:                                                                      ! 
  111. $        EXIT                                                               ! 
  112. $ERROR:                                                                     ! 
  113. $        WRITE SYS$ERROR IFILE," has unexpected record format, can not copy"! 
  114. $        WRITE SYS$ERROR "CDCOPY terminates"                                ! 
  115. $        EXIT                                                               ! 
  116.